const KEY = "hkzf_token"

// 将token 保存到本地
const setToken = token => localStorage.setItem(KEY, token)

// 从本地取出token
const getToken = () => localStorage.getItem(KEY)

// 从本地缓存中移除token
const removeToken = () => localStorage.removeItem(KEY)

// 根据本地缓存中是否有token判断是否登入
const isAuth = () => !!getToken()

export { setToken, getToken, isAuth, removeToken }